.text
.section .rodata
.align 3
.LC0:
    .string "Originally x = %d and y = %d.\n"
.LC1:
    .string "Now x = %d and y = %d.\n"

.text
.align 2
.globl main
.type main, @function
main:
    addi sp, sp, -24
    sd ra, 16(sp)
    sd s0, 8(sp)
    addi s0, sp, 8

    li a5, 5
    // x
    sw a5, -4(s0)
    li a5, 10
    // y
    sw a5, -8(s0)

    lw a1, -4(s0) /* x */
    lw a2, -8(s0) /* y */
    lui a5, %hi(.LC0)
    addi a0, a5, %lo(.LC0)
    call printf

    addi a0, s0, -4
    addi a1, s0, -8
    call interchange

    lw a1, -4(s0) /* x */
    lw a2, -8(s0) /* y */
    lui a5, %hi(.LC1)
    addi a0, a5, %lo(.LC1)
    call printf

    ld ra, 16(sp)
    ld s0, 8(sp)
    addi sp, sp, 24
    jr ra

// 可以不要下面的.text
.text
.globl interchange
.type interchange, @function
interchange:
    lw a5, (a0)
    lw a4, (a1)
    sw a5, (a1)
    sw a4, (a0)
    jr ra